/* indent size: 2 */

module.exports = app => {
  const DataTypes = app.Sequelize;

  const Model = app.model.define('back', {
    id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      primaryKey: true,
      autoIncrement: true,
    },
    number: {
      type: DataTypes.STRING(60),
      allowNull: true,
    },
    backname: {
      type: DataTypes.STRING(60),
      allowNull: true,
    },
    phone: {
      type: DataTypes.STRING(60),
      allowNull: true,
    },
    borrowname: {
      type: DataTypes.STRING(60),
      allowNull: true,
    },
    money: {
      type: 'DOUBLE',
      allowNull: true,
    },
    backdate: {
      type: DataTypes.DATE,
      allowNull: true,
    },
    type: {
      type: DataTypes.STRING(60),
      allowNull: true,
    },
    time: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
    },
    returntime: {
      type: DataTypes.DATE,
      allowNull: true,
    },
    realtime: {
      type: DataTypes.DATE,
      allowNull: true,
    },
    returnmoney: {
      type: 'DOUBLE',
      allowNull: true,
    },
    realmoney: {
      type: 'DOUBLE',
      allowNull: true,
    },
    capital: {
      type: 'DOUBLE',
      allowNull: true,
    },
    interest: {
      type: 'DOUBLE',
      allowNull: true,
    },
    punish: {
      type: 'DOUBLE',
      allowNull: true,
    },
    backtime: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
    },
    repayStateId: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
    },
    debitNum: {
      type: DataTypes.STRING(60),
      allowNull: false,
    },
  }, {
    tableName: 'back',
  });

  Model.associate = function() {

  };

  return Model;
};
